///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug  4 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "HeliCtrl_GUI.h"

///////////////////////////////////////////////////////////////////////////

MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_menubar = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* fileExit;
	fileExit = new wxMenuItem( m_fileMenu, ID_FILE_EXIT, wxString( wxT("E&xit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Exit the application"), wxITEM_NORMAL );
	m_fileMenu->Append( fileExit );
	
	m_menubar->Append( m_fileMenu, wxT("&File") );
	
	m_helpMenu = new wxMenu();
	wxMenuItem* helpAbout;
	helpAbout = new wxMenuItem( m_helpMenu, ID_HELP_ABOUT, wxString( wxT("&About") ) + wxT('\t') + wxT("F1"), wxT("Show info about this application"), wxITEM_NORMAL );
	m_helpMenu->Append( helpAbout );
	
	m_menubar->Append( m_helpMenu, wxT("&Help") );
	
	this->SetMenuBar( m_menubar );
	
}

MainFrame::~MainFrame()
{
}

MainPanel::MainPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	m_notebook2 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_FLAT|wxNB_NOPAGETHEME|wxNB_TOP|wxNO_BORDER );
	m_panel1 = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxVERTICAL );
	
	m_SoftJoy = new wxSoftJoy(m_panel1,wxDefaultPosition);
	m_SoftJoy->SetBackgroundColour( wxColour( 255, 255, 255 ) );
	
	bSizer7->Add( m_SoftJoy, 1, wxEXPAND, 5 );
	
	m_panel1->SetSizer( bSizer7 );
	m_panel1->Layout();
	bSizer7->Fit( m_panel1 );
	m_notebook2->AddPage( m_panel1, wxT("Control"), false );
	m_panel2 = new wxPanel( m_notebook2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer9;
	bSizer9 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText5 = new wxStaticText( m_panel2, wxID_ANY, wxT("RS232 port:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText5->Wrap( -1 );
	bSizer10->Add( m_staticText5, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxString com_portChoices[] = { wxT("COM1:"), wxT("COM2:"), wxT("COM3:"), wxT("COM4:"), wxT("COM5:"), wxT("COM6:"), wxT("COM7:"), wxT("COM8:"), wxT("COM9:") };
	int com_portNChoices = sizeof( com_portChoices ) / sizeof( wxString );
	com_port = new wxChoice( m_panel2, wxID_ANY, wxDefaultPosition, wxSize( 80,-1 ), com_portNChoices, com_portChoices, 0 );
	com_port->SetSelection( 0 );
	bSizer10->Add( com_port, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_PortOpen = new wxButton( m_panel2, wxID_ANY, wxT("Open"), wxDefaultPosition, wxSize( 40,-1 ), 0 );
	m_PortOpen->SetBackgroundColour( wxColour( 255, 0, 0 ) );
	
	bSizer10->Add( m_PortOpen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	bSizer9->Add( bSizer10, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	wxBoxSizer* bSizer111;
	bSizer111 = new wxBoxSizer( wxHORIZONTAL );
	
	mActivityLabel = new wxStaticText( m_panel2, wxID_ANY, wxT("Activity:"), wxDefaultPosition, wxDefaultSize, 0 );
	mActivityLabel->Wrap( -1 );
	bSizer111->Add( mActivityLabel, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
	
	
	bSizer111->Add( 0, 0, 1, wxEXPAND, 5 );
	
	mActivityPanel = new wxPanel( m_panel2, wxID_ANY, wxDefaultPosition, wxSize( 24,24 ), wxSIMPLE_BORDER|wxTAB_TRAVERSAL );
	mActivityPanel->SetBackgroundColour( wxColour( 255, 0, 0 ) );
	
	bSizer111->Add( mActivityPanel, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	bSizer9->Add( bSizer111, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxHORIZONTAL );
	
	battery_voltage = new wxStaticText( m_panel2, wxID_ANY, wxT("Voltage: 0.0000"), wxDefaultPosition, wxDefaultSize, 0 );
	battery_voltage->Wrap( -1 );
	bSizer11->Add( battery_voltage, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	
	bSizer11->Add( 0, 0, 1, wxEXPAND, 5 );
	
	bSizer9->Add( bSizer11, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	wxBoxSizer* bSizer12;
	bSizer12 = new wxBoxSizer( wxHORIZONTAL );
	
	beep_type = new wxSlider( m_panel2, wxID_ANY, 1, 0, 3, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
	bSizer12->Add( beep_type, 1, wxEXPAND|wxALL, 5 );
	
	beep_btn = new wxToggleButton( m_panel2, wxID_ANY, wxT("Beep"), wxDefaultPosition, wxSize( 40,-1 ), 0 );
	bSizer12->Add( beep_btn, 0, wxALL|wxEXPAND, 5 );
	
	bSizer9->Add( bSizer12, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	wxBoxSizer* bSizer13;
	bSizer13 = new wxBoxSizer( wxVERTICAL );
	
	yaw_correction = new wxSlider( m_panel2, wxID_ANY, 8, 6, 12, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
	bSizer13->Add( yaw_correction, 1, wxALL|wxEXPAND, 5 );
	
	bSizer9->Add( bSizer13, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	
	bSizer9->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_panel2->SetSizer( bSizer9 );
	m_panel2->Layout();
	bSizer9->Fit( m_panel2 );
	m_notebook2->AddPage( m_panel2, wxT("Settings"), true );
	
	mainSizer->Add( m_notebook2, 1, wxEXPAND, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	
	// Connect Events
	m_PortOpen->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::PortOpen_ButtonClick ), NULL, this );
	beep_btn->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnBeepBtn ), NULL, this );
}

MainPanel::~MainPanel()
{
	// Disconnect Events
	m_PortOpen->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::PortOpen_ButtonClick ), NULL, this );
	beep_btn->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnBeepBtn ), NULL, this );
}

AboutDlg::AboutDlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* infoSizer;
	infoSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
	
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	m_icon = new wxStaticBitmap( this, ID_ABOUT_ICON, wxICON( amain ), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer10->Add( m_icon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* textSizer;
	textSizer = new wxBoxSizer( wxVERTICAL );
	
	m_staticAppName = new wxStaticText( this, ID_ABOUT_APPNAME, wxT("HeliCtrl"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticAppName->Wrap( -1 );
	m_staticAppName->SetFont( wxFont( 10, 70, 90, 92, false, wxT("Arial") ) );
	
	textSizer->Add( m_staticAppName, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	m_staticVersion = new wxStaticText( this, ID_ABOUT_VERSION, wxT("Version"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticVersion->Wrap( -1 );
	textSizer->Add( m_staticVersion, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	bSizer10->Add( textSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	infoSizer->Add( bSizer10, 1, wxALIGN_CENTER_HORIZONTAL, 5 );
	
	m_staticline1 = new wxStaticLine( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	infoSizer->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 );
	
	m_staticCopyright = new wxStaticText( this, ID_ABOUT_COPYRIGHT, wxT("Copyright © 2009\nMaksymilian Dutka\nGrzegorz Leśniak"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
	m_staticCopyright->Wrap( -1 );
	infoSizer->Add( m_staticCopyright, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	mainSizer->Add( infoSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	m_aboutDialogButtonSizer = new wxStdDialogButtonSizer();
	m_aboutDialogButtonSizerOK = new wxButton( this, wxID_OK );
	m_aboutDialogButtonSizer->AddButton( m_aboutDialogButtonSizerOK );
	m_aboutDialogButtonSizer->Realize();
	mainSizer->Add( m_aboutDialogButtonSizer, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
}

AboutDlg::~AboutDlg()
{
}
